//
//  MPNetworkService.h
//  M800Project
//
//  Created by 姚宗超 on 14/11/5.
//  Copyright (c) 2014年 姚宗超. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "MPHttpRequest.h"

@class MPDeviceObject;

// 关注的资讯、广告类型
typedef NS_ENUM(NSUInteger, eMPInfoType)
{
    eMPInfoTypeP2P = 0,
    eMPInfoTypeZC,
};

// 用户的订阅类型
typedef NS_ENUM(NSUInteger, eMPVisitorSubscribeType)
{
    eMPVisitorSubscribeTypeDefault = 0, // 跳过
    eMPVisitorSubscribeTypeNewer, // 新手上路
    eMPVisitorSubscribeTypeIncome, // 收益为王
    eMPVisitorSubscribeTypeEfficient,  // 快进快出
    eMPVisitorSubscribeTypeRefresh  // 20s刷新
};

// 升降序
typedef NS_ENUM(NSUInteger, eMPSort)
{
    eMPSortUp = 0, //升序
    eMPSortDown, //降序
};

// 排序方式
typedef NS_ENUM(NSUInteger, eMPSortType)
{
    eMPSortTypeDefault = 0, //默认排序
    eMPSortTypePlatform, //以平台排序
    eMPSortTypeRate, //以收益率排序
    eMPSortTypeMonth, //以期限排序
    eMPSortTypeProgress //以进度排序
};


@interface MPNetworkService : NSObject

#pragma mark - general
//登记设备
+ (void)registerDeviceWithObject:(MPDeviceObject *)device onComletion:(MPRequestComplete)block;

#pragma mark - bid相关
//热标接口
+ (void)fetchHotBidWithDeviceId:(NSString *)dId subscribeType:(eMPVisitorSubscribeType)subsType sortType:(eMPSortType)sortType upOrDown:(eMPSort)upOrDown onComletion:(MPRequestComplete)block;


#pragma mark - news相关
//资讯接口
+ (void)fetchNewsWithInfoType:(eMPInfoType)infoType page:(NSUInteger)pageNum onComletion:(MPRequestComplete)block;

#pragma mark - advertise
//广告接口
+ (void)fetchAdvertiseWithInfoType:(eMPInfoType)infoType onComletion:(MPRequestComplete)block;

#pragma mark - subscribe
//修改我的订阅选项
+ (void)modifyMySubcribeWithDeviceId:(NSString *)dId platformCode:(NSString *)pCode rateCode:(NSString *)rCode durationCode:(NSString *)dCode onCompletion:(MPRequestComplete)block;

+ (void)modifyMySubcribeWithDeviceObject:(MPDeviceObject *)device onCompletion:(MPRequestComplete)block;

//APP用户手动更新是否开启推送功能
+ (void)modifyPushStateWithDeviceId:(NSString *)dId state:(BOOL)isPushOn onCompletion:(MPRequestComplete)block;

//APP判断网络连接成功的接口
+ (void)isNetworkConnectedWithCompletionHandler:(MPRequestComplete)block;

//获取我的订阅接口
+ (void)fetchMySubcribeInfoWithDeviceId:(NSString *)dId onCompletion:(MPRequestComplete)block;

//所有平台列表接口
+ (void)fetchAllPlatformWithDeviceId:(NSString *)dId onCompletion:(MPRequestComplete)block;

//添加平台
+ (void)addPlatformWithDeviceId:(NSString *)dId platformCode:(NSString *)codeString onCompletion:(MPRequestComplete)block;

//删除平台
+ (void)removePlatformWithDeviceId:(NSString *)dId platformCode:(NSString *)codeString onCompletion:(MPRequestComplete)block;

@end
